import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        System.out.println("请输入密码：");
        int num=3;
        while(num!=0){
            Scanner in=new Scanner(System.in);
            String str=in.nextLine();
            if(str.equals("123456")){
                System.out.println("登录成功");
                break;
            }else{
                System.out.println("密码错误，请重新输入");
            }
            num--;
        }
        if(num==0){
            System.out.println("登录失败，退出程序");
        }
    }
}
